package org.sam.swing.table.defaultImpl;

import org.sam.swing.table.DataTranslator;
import org.sam.swing.table.JSTableColumn;

/**
 * 默认的数据转换工具
 * @author sam
 *
 */
public class DefaultDataTranslator implements DataTranslator {

	/**
	 * {@inheritDoc}
	 * @param tableColumn
	 * @param clazz
	 */
	public DefaultDataTranslator(JSTableColumn tableColumn , Class<?> clazz){
		this.seTableColumn(tableColumn);
		this.setTargetClass(clazz);
	}
	
	/**
	 * 绑定的列
	 */
	private JSTableColumn col;
	
	/**
	 * 绑定的目标列
	 */
	private Class<?> cls;
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public JSTableColumn geTableColumn() {
		return this.col;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void seTableColumn(JSTableColumn tableColumn) {
		this.col = tableColumn;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Class<?> getTargetClass() {
		return this.cls;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void setTargetClass(Class<?> clazz) {
		this.cls = clazz;
	}

}
